//
//  ModalViewViewController.m
//  ModalView
//
//  Created by smu on 11-7-30.
//  Copyright 2011年 duk. All rights reserved.
//

#import "ModalViewViewController.h"
#import "ModalWebViewController.h"

@implementation ModalViewViewController
@synthesize button;

-(IBAction)press:(id)sender
{
    NSLog(@"sddd");
    ModalWebViewController *controller = [[[ModalWebViewController alloc]
                                           initWithNibName:@"ModalWebViewController" bundle:nil] autorelease];
    controller.modalPresentationStyle = UIModalPresentationFormSheet;
    controller.delegate = self;
    [self presentModalViewController:controller animated:YES];
}



- (void)dealloc
{
    [super dealloc];
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

/*
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
    [super viewDidLoad];
}
*/

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return YES;
}

//通过委托方法处理模态视图的移除
-(void)modalWebViewControllerDidFinish:(ModalWebViewController *)controller
{
    [self dismissModalViewControllerAnimated:YES];
}

@end
